<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>后台管理</title>
    <%@include file="../common/common.jsp"%>
</head>

<body>

<%@include file="navTop.jsp"%>
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
                <li ><a href="<%=path%>/admin/scenic_spot">景区管理</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li><a href="<%=path%>/admin/hotel">酒店管理</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li><a href="<%=path%>/admin/ticket">票务管理</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li><a href="<%=path%>/admin/user">用户管理</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li class="active"><a href="<%=path%>/admin/index">首页设置</a></li>
            </ul>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h2 class="sub-header text-center">首页设置</h2>

            <hr>
            <div class="row">
                <div class="col-md-10">
                    <label class="text-left"
                           style="width: 100%;line-height: 34px;">建议尺寸高度350px</label>
                    <form>
                        <input id="file-1" type="file" name="file" multiple class="file"
                               data-overwrite-initial="false" data-min-file-count="1">
                    </form>
                </div>
            </div>
            <div class="row" style="text-align: center;">
                <div class="col-md-10">
                    <%--<button type="button" class="btn signin_btn" id="btnSubmit">
                        保存
                    </button>--%>
                </div>
            </div>

        </div>


    </div>
</div>
<script type="text/javascript">
    var imgNames=[];
    $("#file-1").fileinput({
        uploadUrl: CONTEXT_PATH+'/index/uploadSlide',
        showPreview: true,//是否显示文件预览
        allowedFileExtensions: ['jpg', 'png', 'gif'],
        overwriteInitial: false,
        maxFileSize: 1000,
        maxFileCount: 4,
        dropZoneEnabled: true,//拖拽图片
        uploadLabel: "上传",
        showUpload: true,
        maxImageWidth: 950,//图片的最大宽度
        maxImageHeight: 500,//图片的最大高度
        initialCaption: "请上传",
        dropZoneTitle: "可以将图片拖放到这里",
        enctype: 'multipart/form-data',
        layoutTemplates: {
            showRemove: true,                                   // 显示删除按钮
            showUpload: true,                                   // 显示上传按钮
            showDownload: false,                            // 显示下载按钮
            showZoom: false,                                    // 显示预览按钮
            showDrag: false,                                        // 显示拖拽
            actionUpload: '<i class="fa fa-upload"></i>',//去除上传预览缩略图中的上传图片
            actionZoom: '',   //去除上传预览缩略图中的查看详情预览的缩略图标
            actionDelete: '<i class="fa fa-trash"></i>', //去除上传预览的缩略图中的删除图标
        },//对象用于渲染布局的每个部分的模板配置。您可以设置以下模板来控制窗口小部件布局.eg:去除上传图标

    }).on('fileuploaded', function (event, data, previewId, index) {//上传成功
        /* $("#fileName").val(data.response[0].fileName);
        $("#eosid").val(data.response[0].eosid); */
        console.log(data.response);
        if(data.response!=="error"){
            imgNames.push(data.response);
        }else{
            swal("","上传失败！发生错误！","error")
        }
    }).on('fileerror', function (event, data, msg) {//上传失败
        swal("错误！",data,"error")
    });



</script>
<style>
    .btn.signin_btn,
    .btn.signin_btn:focus {
        width: 620px;
        padding: 0;
        height: 60px;
        background: #5a84fd;
        color: #fff;
        font-size: 30px;
        text-transform: uppercase;
        border-radius: 3px;
        box-shadow: 0 5px 30px rgba(0, 66, 255, .3);
        margin-top: 20px;
    }

</style>


</body>

</html>